#include "regex_vm.h"
#ifndef REGEX_PARSER_H
#define REGEX_PARSER_H
enum ast_node_type {
	t_char,
	t_word,
	t_number,
	t_plus,
	t_multi,
	t_split,
	t_lp,
	t_rp,
	t_con,
	t_space,
	t_any,
	t_nonespace
};

typedef struct _ast_node{
	enum ast_node_type type;
	unsigned char c;
	struct _ast_node *left;
	struct _ast_node *right;
} ast_node;

ast_node *make_ast_node(enum ast_node_type t);
ast_node *parse_regex(unsigned char *regex,int length);
void display_ast(ast_node *,int);
instruction* regex_compile(ast_node *);
void display_instruction(instruction *start);
#endif